public class DetailTemplateModel extends Object implements XMLMarshallable
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:simpleType name="propertyDTType">
<xs:restriction base="xs:string">
<xs:enumeration value="string"/>
<xs:enumeration value="number"/>
<xs:enumeration value="date"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="detailTemplate">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="propertyDTType"/>
<xs:attribute name="defaultValue" type="xs:string"/>
<xs:attribute name="propertyName" type="xs:string"/>
</xs:complexType>
</xs:element>
| Constructor and Description |
|---|
DetailTemplateModel()
Builds an empty DetailTemplate.
|
DetailTemplateModel(String name,
int type,
Object defaultValue,
String propertyName)
Builds a DetailTemplate.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
DetailTemplateModel |
duplicate()
Returns a new clone instance of this DetailTemplateModel
|
Object |
getDefaultValue()
Returns the default value of the DetailTemplate.
|
String |
getName()
Returns the name of the DetailTemplate.
|
String |
getPropertyName()
Returns the name of the property mapped to this detail.
|
int |
getType()
Returns the type of the DetailTemplate.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setDefaultValue(Object defaultValue)
Sets the value of the DetailTemplate.
|
void |
setName(String name)
Set the name of the DetailTemplate
|
void |
setPropertyName(String propertyName)
Returns the name of the DetailTemplate.
|
void |
setType(int type)
Set the type of the DetailTemplate.
|
public DetailTemplateModel()
public DetailTemplateModel(String name, int type, Object defaultValue, String propertyName)
name - the name of the detail.type - the type of the detail.defaultValue - the default value (null if no default value) of the detail.
This value must be compatible with the declared type.
This value is taken if the propertyName is not found in the Rating Context.propertyName - the mapped property name (null if no mapping required).Type.STRING,
Type.NUMBER,
Type.DATEpublic String getName()
public void setName(String name)
name - : name of the DetailTemplate.public String getPropertyName()
public void setPropertyName(String propertyName)
propertyName - the name of the mapped rating property.
can be null if no mapping required.public int getType()
Type.STRING,
Type.NUMBER,
Type.DATEpublic void setType(int type)
type - : The new type;public Object getDefaultValue()
java.math.BigDecimal
for a NUMBER type.java.util.Date
for a DATE type.java.lang.String
for a STRING type.Type.STRING,
Type.NUMBER,
Type.DATEpublic void setDefaultValue(Object defaultValue)
defaultValue - the value of the DetailTemplate.getDefaultValue(),
Type.STRING,
Type.NUMBER,
Type.DATEpublic DetailTemplateModel duplicate()
public void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into